/*
 * jxDao Project (2014)
 * 
 * by Denilson Edinaldo Pinto
 * 
 * LGPL
 * Copyright (C) 2014
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.jxDao.dao.i18n;

import java.util.Locale;

import org.jxUtils.i18n.Localizator;

/**
 * @author Denilson Edinaldo Pinto
 * @porject jxDao
 * @package org.jxDao.dao.i18n
 * @date 12/04/2014 - 10:19:24
 */
public final class DaoMessages extends Localizator {
	
	static final String PACKAGE_NAME = DaoMessages.class.getPackage().getName();
	
	private static final String CLASS_NAME = DaoMessages.class.getSimpleName().replace("Messages", "");
	
	/**
	 *
	 */
	public DaoMessages() {
	
		this(Locale.getDefault());
	}
	
	/**
	 * @param locale
	 */
	public DaoMessages(final Locale locale) {
	
		super(PACKAGE_NAME + ".messages." + CLASS_NAME, locale);
	}
	
	/**
	 * @return i18n message
	 */
	public String anotherOrderByAlreadyImplemented() {
	
		return getMessage("another.OrderBy.already.implemented");
	}
	
	/**
	 * @param attribute
	 * @return i18n message
	 */
	public String attributeCannotBeNull(final String attribute) {
	
		return getMessage("$attribute.cannotBe.null", attribute);
	}
	
	/**
	 * @param attribute
	 * @param length
	 * @return i18n message
	 */
	public String attributeLengthGreaterThan(final String attribute, final double length) {
	
		return attributeLengthGreaterThan(attribute, String.valueOf(length));
	}
	
	/**
	 * @param attribute
	 * @param length
	 * @return i18n message
	 */
	public String attributeLengthGreaterThan(final String attribute, final String length) {
	
		return getMessage("$attribute.$length.greaterThan", attribute, length);
	}
	
	/**
	 * @return i18n message
	 */
	public String connectionAlreadyOpen() {
	
		return getMessage("connection.alreadyOpen");
	}
	
	/**
	 * @return i18n message
	 */
	public String connectionIsAutoCommit() {
	
		return getMessage("connection.isAutoCommit");
	}
	
	/**
	 * @return i18n message
	 */
	public String connectionIsClosed() {
	
		return getMessage("connection.isClosed");
	}
	
	/**
	 * @param driver
	 * @return i18n message
	 */
	public String driverNotFound(final String driver) {
	
		return getMessage("$driver.notFound", driver);
	}
	
	/**
	 * @param tableName
	 * @return i18n message
	 */
	public String inTable(final String tableName) {
	
		return getMessage("in.$table", tableName);
	}
	
	/**
	 * @param objectClass
	 * @return i18n message
	 */
	public String invalidObjectToClass(final Class<?> objectClass) {
	
		return getMessage("invalid.object.to.$class", objectClass.getName());
	}
	
	/**
	 * @return i18n message
	 */
	public String notPossibleCloseConnection() {
	
		return getMessage("connection.notPossible.close");
	}
	
	/**
	 * @return i18n message
	 */
	public String notPossibleCloseStatement() {
	
		return getMessage("statement.notPossible.close");
	}
	
	/**
	 * @return i18n message
	 */
	public String notPossibleCommit() {
	
		return getMessage("transaction.notPossible.commit");
	}
	
	/**
	 * @return i18n message
	 */
	public String notPossibleCreateStatement() {
	
		return getMessage("statement.notPossible.create");
	}
	
	/**
	 * @return i18n message
	 */
	public String notPossibleOpenConnection() {
	
		return getMessage("connection.notPossible.open");
	}
	
	/**
	 * @return i18n message
	 */
	public String notPossibleRollback() {
	
		return getMessage("transaction.notPossible.rollback");
	}
	
	/**
	 * @return i18n message
	 */
	public String operationAborted() {
	
		return getMessage("operationAborted");
	}
	
	/**
	 * @return i18n message
	 */
	public String operationSuspected() {
	
		return getMessage("operation.suspected");
	}
	
	/**
	 * @param database
	 * @return i18n message
	 */
	public String permissionDeniedInDatabase(final String database) {
	
		return getMessage("permission.denied.in.$database", database);
	}
	
	/**
	 * @param schemaName
	 * @return i18n message
	 */
	public String permissionDeniedInSchema(final String schemaName) {
	
		return getMessage("permission.denied.in.$schemaName", schemaName);
	}
	
	/**
	 * @param tableName
	 * @return i18n message
	 */
	public String permissionDeniedInTable(final String tableName) {
	
		return getMessage("permission.denied.in.$table", tableName);
	}
	
	/**
	 * @return i18n message
	 */
	public String transactionAlreadyOpen() {
	
		return getMessage("transaction.alreadyOpen");
	}
	
	/**
	 * @param value
	 * @param valueType
	 * @param field
	 * @param fieldType
	 * @return i18n message
	 */
	public String valueIsNotSupportedInField(final Object value, final Object valueType, final Object field, final Object fieldType) {
	
		return getMessage("$value.$valueType.isNotSupported.in.$field.$fieldType", value, valueType, field, fieldType);
	}
}
